﻿using System;
using System.Text;
using System.IO;

namespace imeem.api.util
{
	public enum PostParameterType
	{
		File,
		Parameter
	};
	
	public class PostParameter
	{
		public string Name = null;
		public object Value = null;
		public PostParameterType Type = PostParameterType.Parameter;
		public string Filename = null;
		
		public PostParameter(string name, object value)
		{
			this.Name = name;
			this.Value = value;
			this.Type = PostParameterType.Parameter;
		}
		
		public PostParameter(string name, string filename, object value, PostParameterType type)
		{
			this.Name = name;
			this.Value = value;
			this.Type = type;
			this.Filename = filename;
		}
		
		public static string GetOnlyFileName(string filename)
		{
			return System.IO.Path.GetFileName(filename);
		}
	}
}
